amending prev commit to fix bug in matrix.h