copied hash() fucntion from main.cpp to HashTable.ipp