Correct regress function and add calculation of regression norms to regress function