Fixed errors in scheduling_algorithm 2