got duration calculation working