Cleaned up the output with a small logger and removed unused code.