Saving current state before possibly messing stuff up.