using next() and previous() function now