May have fixed the tab issue. Also refactored to be nice.