refactored and got the tabs to work