Added some matrix functions.