matrix now saves and loads its state.