add scheduler and tests