added support for priority queue to node struct
refactor of explore method to use priority queue