Need the Right Node, Custom height blend Function

hi guys just getting confused on how to join something up on a material function i made to control height and angle of landscape materials the plan is to use it on something like grass to stop it growing below sea level and stop it above a height where it wouldn’t grow it works great as a single height control but i want to use it to control it at both sides… the problem is the maths are wrong on joining the two as one takes from the other and cancels each other out giving what ever number it calculates as the answer the part marked in red comment is what needs working out any help i would be grateful (stop grass at sea level and stop grass at high altitude) NEED the right nodes???