adding scheduler code