Another thing that is not clear on reading through this code is how calcDeepest[Last]Onscreen() differs from recomputeFirstAndLastOnscreen(). A bit more explanation somewhere would help.