Added a nice heuristic for finding optimals