updated to run on iOS 5 instead of 3