Implemented simple versions of next-line and previous-line.