minor changes to output of matmult_p, fully implemented matformatter