private boolean setCoordinates(int r, int c) {

                // If the coordinates are not already set
                if (!areCoordinatesSet()) {

                        // Ensure valid coordinates
                        if (!validCoordinates(r, c)) {
                                throw new IllegalArgumentException("Invalid coordinates");
                        }

                        // Set the coordinates
                        row = r;
                        col = c;

                        return true;

                }

                else {
                        return false;
                }

        }