Changed serialize method to serialize_to_hash to reflect code changes.