Added ability to set maximum number of items through the user interface