Properly implemented the scheduling algorithms