Also, move expectedFireTime definitions to top of function.  Javascript already does this for you, but you refer to them above, which is super hard to read.