tweaks: put some prototypes in the proper order, and move a bit of code
3 files changed