added time calculatn