Added portrait and lascape mode handling