Creating Tuples and Sorting lists of Tuples