added basic paging routines (some untested)