Added shakeDetect logic

I accidentally reverted Divij's changed but then checked them in with my code. Sorry about that still getting used to git.