Added states, restructured slightly