correctly calculate overall time