It was long enough ago (around 1997 IIRC) that I don't recall the details. I think most of the problem was that I kept running into fencepost errors and finding edge cases around a string being exactly the same size as the window. One of my more embarrassing programming escapades that no one would have ever known about if I wasn't dumb enough to mention it online...