Better page sequence logic