Changed open node logic to use a priority queue improving performance 10x.