Enum states work

Not sure if it's any better, added about 100 lines of code.