improved the "check" method and fixed an error in the chooseCell method which caused an error when the empty[] array is empty