added support for portrait orientation