from: http://code.tutsplus.com/tutorials/build-an-exercise-tracking-app-persistence-graphing--mobile-11074