Implemented functionality of previous and next question