cleanup function

Cleans up the files and directories created during the process