recursive method changed, needs further development, currently works not for board size 4 anymore
recursive algorithm further changed, not better though