Added in variable to adjust for last page