added and rearranged paging