Paying down your mortgage before the HELOC if the mortgage rate is greater makes sense, more so assuming the following:
Assuming your HELOC was set up for the purpose of investing, the interest you pay on the HELOC is tax deductable.
The interest you are paying on your mortgage is not.
You...