Max Heap Tree Code In Python For Games