changed prev next to a loop 2