Added constants for some magic values. Fixed a bug in get_total_time_at_occupancies