added option for hash function