Changed to associative array and better variable names
Changed popover to use associative array
Fixed syntax