More statemachine work. Basic class structure