fixed bug with resolve inadvertantly transposing the matrix (a problem with non-square matrices)