better pagination - needs testing