changed to priority heap