added next functionality