improved time budget function