Fixed next working on prev
Fixed prev and cleaned up a bit