Updated Index.js funciton to run on document ready to short hand