Final pass, code fixup