Your code seems to only be reading 4 pins and some of them are invalid. Also GPIO6 only gives us 10 pins of the pins we need.
I have been modeling a solution with the following pins.
[ GPIO7 | GPIO9 | GPIO6 | GPIO6 ]
[10, 12, 11 | 2, 3, 4 | 19, 18, 14, 15 | 17...