Prev next buttons

Lot of cleanup.