main.js code refactored to use 4 spaces for indentation.