Noticed a couple of inconsistancies on the PORTB/D labels on this page: http://www.arduino.cc/en/Reference/PortManipulation
PORTB is the register for the state of the outputs. For example; PORTD = B10101000; // sets digital pins 7,5,3 HIGH You will only see 5 volts on these pins however if the pins have been set as outputs using the DDRD register or with pinMode(). PINB is the input register variable It will read all of the digital input pins at the same time.
Might save some confusion by sticking to PORTD for the entire example.