matrix system independent now
cleanup matrix
further cleanup