Moved hash generating function to main instead.