func reordering. include fixes. tweaks