Updated Main.js File for Final