code for saving and loading fly data implemented using pickle