formatted main.js, cleaned up syntax, etc