match data saving and loading encoding