Updated to latest version of Shangjie's Python translation