Added some scheduler code