Added time and stop condition.