Please edit your post, select the code, and put it between [code] ... [/code] tags.
You can do that by hitting the # button above the posting area.
... a random combination of "HIGH" or "low" when no voltage is applied ...
"No voltage" is not the same as "setting the pin low". If the pins are unconnected they may pick up random readings which would vary as you waved your hand around, for example.