scheduler first working version