Scheduling algorithm updated

Resolves issues: #19, #20, #25