implemented duplicating of elements in a list N times (p15)