fix bad naming and bug in calculateDeltaMs