Added a clean() function to the python wrapper