added pagination. need more work on the framework