corrected max time calculation