Added support for landscape view; Modularised the code
reorganisation of code