private String mutate(String child) {
        for (int i = 0; i < child.length(); i++) {
            if (rand.nextInt(mutateRate) == 1) {
                if (child.charAt(i) == '0') {
                    String bit = "";
                    if (child.charAt(i) == 0) {
                        bit = "1";
                    } else {
                        bit = "0";
                    }
                    if (i == 0) {
                        child = bit + child.substring(1);
                    } else if (i < child.length() - 1) {
                        child = child.substring(0, i) + bit + child.substring(i + 1);
                    } else {
                        child = child.substring(0, i) + bit;
                    }
                }
            }
        }
        return child;
    }