added an implementation of a WSChan state machine + tests