fix matrices
remove debug statements