Coverting the lists into tuples and hashing them