Added some rotation support code. Still fine tuning between iOS 6 and 7