Moved ds_record_equal_key from hash to array and refactored code