Replaced `TreeMap` with `PriorityQueue` use to streamline code and optimize mem footprint