Huge modifications, state machine