Offset now calculates based on all previous pages

Previously, it incorrectly only used the one previous page