required to re-arrange several functions in order to use the new util::floordiv and to get all relevant calculations into time.h