Correctement rule bug

Now the rules are correctly respected. The bug was due to a bad use of
C#'s references via Array.CopyTo(). I rewrote a function that does
pretty much the same task, but that doesn't assign references, but
actual values. So the grid and copy grid are not the same object.