cleaned up cursor movement