Priority queue

Improve readability and pythonicity