fixing time calculation. not done yet