Tidying up algorithm for Open scrolling. Also Open cursor.