created a destructor for Hash class