Added cursor movement and flipping