Solution to the Minesweeper Java Problem