added a state determinator