Update main.js

changed the ordering so that intiial variables are called, in theory, before localstorage is called