remove debug code from weightmatrix