Removing transpose from get_poly_dim function