starting at the top-level working in a U-shape towards the top-right, number each "usable" pin sequentially.
oh lordy... all these years i thought portd was pins 1-7, portb 8-15, etc.. now i see that was coincident and the real method was far more ridiculous than i imagined. who are these guys and what are they trying to do to me?