private int numberOfRows() throws IOException {
        Scanner scanner = new Scanner(filePath);
        int i = 0;
        while (scanner.hasNextLine()) {
            i++;
            scanner.nextLine();
        }
        scanner.close();
        return i;
    }