added renderItems() function