Created function which duplicates a list