Issue with two next() and two prev() methods