refactored the hash_diff method to work for more cases.  Added tests for same.