added code for consistent hashing