Code for maximizing the Ingress fields on a given set fo portals