Fixed and simplified smooth-scroll JS function so that it loads faster