Cleaned up hash method, more tests