get rid of slow random_matrix() call