implemented another way of finding next and prev (more kiss)