made some minor change
implemented pagination