Added viewprev and viewnext. Minor improvements. Commented changes.