Heap

Improve pythonicity and readability