major refactoring to update schedule function, added added descriptive counter variable names, white space