Add support for adding new items to the top or the bottom