start cleaning up the nnls function