Add proper saving and loading of measurements