The iterator is the last argument. There is also no returned notes, just ids, so the comment about freeing is out of place.