Adding code for consistent hashing