impl prev() and next() method