Wrote functions for pickling and reading pickles