Based on the tutorial found in raywenderlich.com