works fine, only problem is: 'doesn't return the correct number of elements as the second argument of the callback'