Removed PQueue, made it more efficient