first optimizing algorithm for locations added refs #2543