refactored jquery for effect