Right now I am just checking if the phone is accelerating in any direction, it sort of works but isn't smooth enough for this application. Will require researching actual algorithms (can you call it that?)