implement PublishedItemsService
implement last part of the new algorithm
support changes in main method