Variable renaming and additional logging

Logs to console and clears variables after script completion