cleaned up some of the code, added comments, fixed print_steps()function