Major refactor - switched to an unconstrained optimization by making M = A - A^T