improvement to python module