calculates the total time, need to work on json file though