Updated scheduling algorithm to generate new schedule everytime

The scheduling algorithm now takes into account the class capacity

Added/Updated various functions to help in scheduling