made all tabs work, fixed numerous bugs