Tidied main.js from debug logging