TW: Added pagination handling (somewhat hacky).