using a list comprehension to generate triplets