implemented duplicating of elements in a list (p14)