calculating the distance to the new footer top correctly plus some VERY minor refactoring in lieu of a more serious effort