modularized the component, updated logic, added browser fallback
fixed merge conflicts