removed unnecessary fields in child classes
changed data structure from List<Node> to Deque<Node> to provide a more clear Q functionality