Added function clean_file()