Fixed pages loop. Now repeats for any number of pages that a person has