in preinspectionState, changed mainCurrentState to currentState to allow the state to update its output