added a `compare_table` function to util.lua