To put it simply, all I had to add was a "-1" in the code while the computer picks the right piece to place. And the code looks good and clean, beautiful.