Moved scheduler to its own file
Added stuff