public LinkedList<CellToVisit> shortestPath(int startingX, int startingY,
           int endingX, int endingY,
           final  LinkedList<CellDescription> map, boolean g) {
      /*setup some private variables*/
      graphics = g;
      LinkedList<CellDescription> returnCells = new LinkedList<>();
      LinkedList<CellToVisit> returnValue = new LinkedList<>();
      sX = startingX;
      sY = startingY;
      eX = endingX;
      eY = endingY;
      localMap = map;
      openList = new LinkedList<>();
      closedList = new LinkedList<>();

      /*setup graphics if desired*/
      if (graphics) {
         graphic = new AStarGraphics(localMap, openList, closedList, returnCells);
      }

      /*find path from starting coordinates to ending coordinates*/
      generateOpenAndClosedLists();

      /*populate return path by tracing paretn cell back to starting coordinate*/
      returnCells.addLast(closedList.getLast().cd);
      returnValue.addLast(new CellToVisit(closedList.getLast().cd.locX, closedList.getLast().cd.locY));
      Cell tempC = closedList.getLast();
      int tempx;
      int tempy;
      do {

         tempx = tempC.parentX;
         tempy = tempC.parentY;

         for (int i = 0; i < closedList.size(); i++) {
            if (tempx == closedList.get(i).cd.locX
                    && tempy == closedList.get(i).cd.locY) {
               returnCells.addLast(closedList.get(i).cd);
               returnValue.addLast(new CellToVisit(closedList.get(i).cd.locX, closedList.get(i).cd.locY));
               tempC = closedList.get(i);
               break;
            }
         }
         if (graphics) {
            graphic.updateGraphics();
         }
      } while (tempx != sX || tempy != sY);
      if (graphics) {
         graphic.remove();
      }
      return returnValue;
   }