private void generateOpenAndClosedLists() {

      /*load intial starting cell into the open list*/
      for (int i = 0; i < localMap.size(); i++) {
         if (localMap.get(i).locX == sX && localMap.get(i).locY == sY) {
            openList.add(generateNewCell(localMap.get(i), new Cell(localMap.get(i), sX, sY, 0, 0)));
            break;
         }
      }
      /*loop unit finished*/
      for (;;) {
         if (graphics) {
            graphic.updateGraphics();
         }
         /*find the lowest score*/
         int lowestFScore = Integer.MAX_VALUE;
         for (int i = 0; i < openList.size(); i++) {
            if (openList.get(i).fScore < lowestFScore) {
               lowestFScore = openList.get(i).fScore;
               openList.addLast(openList.get(i));
               openList.remove(i);
            }
         }
         /*remove lowest score from the open list and add to closed list*/
         closedList.addLast(openList.removeLast());

         /*if this is has a h score of zero then we are at our destination*/
         if (closedList.getLast().hScore == 0) {
            break;
         }
         /*add 4 adjacent squares to open list if applicable*/
         addAdjacentCells(closedList.getLast());
      }
   }