updated JS file to include previous functional JS code