Fix bug where items were being reversed and break function apart.