new attempt to fix matrix_builder