Add group state machine. Test it.