incorporated a next page function