Rewrite Scheduler interrupt function

Scheduler is signficantly simpler to read through