Pedometer code

Working fine but could possibly be improved