change functions to python3 style for support of last versions