added first matrix functions