cleaning and working on scheduler