Added code for portrait orientation

Now it works in portrait (single pane)