Adding ability to specify number of returned rows in main query.