Added a switch for orientation
Better handling of gestures