Adapts to many pages automatically, no need to add new else if statements.
Adapts to many pages automatically

Now you don't have to add a new else if statement for every page. Just
set the number of pages and it adapts.