made a simple hash function for index dictionary