adding some matrix functions