add unitseconds in algorithm