Fixed everything but an infinite loop on pages ending in numbers
Eh. Still duplicates sometimes. But done is better than perfect.