Add paging code.

This code haven't compiled yet.