ripped out the matrix functions