change the argument ordering
added a more flexible scheduler; not tested

not thoroughly