diver_calc refactored to be more testable