create state machine for judgement process