Page sorting update

Still not finished