moved states to enums. added location code