We don't want to lose the call to clearTriggerLine, but you could move it into setCursorToY: