FIxed sorting.
Added pagination.