First working version of scheduler