added functionality to limit the number of results returned