rewrote code in scheduelerm and also wrote test for part 1. almost working correctly.