Added rotation handling and autolayout constraints