Very simple working scheduling algorithm.  Needs optimization
Small optimizations