added beginning of FSM and made a NOR gate