Adding nextLeafPage to the footer. Removing ambiguous writeFooter functions