Altered the div creation function into an IIFE