added pickle methods

added pickle methods