Finalized working model (for all but Hadamard matrices, ugh)