public ArrayList<Node> calculatePath(Node p_Start, Node p_Goal)
    {
        ArrayList<Node> nodes = new ArrayList<>();
        boolean done = false;
        Node temp = p_Goal;
        while(!done)
        {
            //always add the new node at the beginning of the list
            nodes.add(0,temp);
            //get the previous node from the temp.
            temp = temp.previous;
            //if the temp is equal to the start node then the path is recreated.
            if(temp == p_Start)
                done = true;
        }
        
        return nodes;
    }