Use the global $log already available
Use a confirm box before running the tool
Removed unused code