add first and last navigation buttons, add conditional history preservation logic