added previous, next functionality