Updated sample code for iPhone 5