adds logic for three dropdown menus