put hydraulic parameter calculations in separate functions