Got state machinemachine working; integrating with other modules