Wrapped the javascript in an IIFE