implementing a recursive directory deletion algorithm to clean up the temp files.