how to wire separate power for motor shield

Went back and double-checked the polarity being supplied correctly to the power pins for the motors--the ones sticking up from the shield in the image. Didn't make any difference. I did notice that the B pin, which the test code is currently cycling from low to high, goes from -.04 to +09 volts, as though power from the arduino was somehow leaking into the B pins from some connection. Also, you mentioned that the ground for the 5v and ground for the VIN were connected. I'm not sure that's true. One ground pin sticks up and one ground pin sticks down. Don't think they're connected. I could solder between them to connect them electrically. I should mention that the motor shield does have a 0v pin on the far side from the motor pins that sticks down and connects to GND pin on the Arduino, next to pinhole 13. This might provide a common connection or not. I can't tell.