public function calculate()
    {
        $this->calculatePageLimitAndOffset();
        $pageNumber = $this->getPageNumber();
        $offset = $this->getPaginationOffset();


        /* Setup page vars for display. */
        if ($pageNumber == 0) {
            $pageNumber = 1; //if no page var is given, default to 1.
        }
        $this->previous = $pageNumber - 1;
        $this->next = $pageNumber + 1;
        //last page is = total pages / items per page, rounded up.
        $this->lastPage = ceil($this->getTotalNumberOfPages() / $this->perPage);

        $this->lastPageMinusOne = $this->lastPage - 1;  //last page minus 1
        $this->create();
    }