three ifs to one case
speedup schedule