added the ability to determine how many items are returned