implemented some states and made a some minor tweaks