created next function with proofs on the resulting d, l > 0 \/ r > 0 -> d > 0.