finetuning code, rewritten pagination and tabs