Added some basic pagination code