added time estimation code