more work around the state machine etc. also more stats