saving and loading encoded algorithm