folio numbers are fully working

this leaves only some basic changes to get Jamil's latest
request fully implemented.