UPdated to use threadpools and a real hash function