safer hash function and naming changes