Simple matrix implementation