Incrementing the rows causes a partial reset. This one is probably important to study. The style of programming might explain the other strange bugs in the game. they seem to be working fine initially, but has problems as the fields are populated or incremented.