add getLastPage functionality. increased tests