Adding method next() and prev()