Welcome, Help us help and post your code following the forum guidelines and use code tags. What you have posted is not readable for me. I cannot follow your tangle of wires can you post a schematic. I have a pin board that looks like the one you have but the power rails are broken in the middle. On yours it would be between the blue and white wires.
Guidelines: Please read the advice in the topic "How to get the best from this forum". How to get the best out of this forum