changed time_result logic to a better/more correct conditional structure