cleaned up code and removed main from stepcounter