better way to change cursor position