function PriorityQueue.Pop(b)local w=b.heap local H=w[1][1]w[1]=w[b.current_size]w[b.current_size]=nil b.current_size-=1 b:sink()return H end return PriorityQueue

function PriorityQueue:Pop()
	local heap = self.heap
	local orig = heap[1][1]
	
	heap[1] = heap[self.current_size]
	heap[self.current_size] = nil
	
	self.current_size -= 1
	self:sink()
	
	return orig
end

return PriorityQueue
