added a more flexible scheduler; not tested

not thoroughly