Nextpage calculation