Add to_hash method