added sorting by publication date and refactoring