Sort:  

Ah.. please run this script with python3
Thanks for testing and please let me know if you find bugs

(I just fixed rounding error and am testing now. Will update the repo soon)