Replace the page left space calculate method