designed the right arrow functionality