adding matrix functions to package