wrote some ugly code to compare hashes