Made the first iteration of scheduler