Removed deprecated variables. Updated for iOS 6