added code that supports iphone and ipad resolution