added core functionality and pagination