Cleaned the code and fixed some errors on the pedometer