tweaks for non square matrices
adding tests for non-square matrices