added method to_hash.