second try at sorting pages