added multi-item functionality. Also some code reorganizing