cleaned up HashBuild and added tests