targetfunction contains all elements