cleaning c and python code