amatrix added but not quite right yet