simplified (I think) page turning so there is less redundant code