Proper merging of lists