working on generalizing scheduler