The Use of Factorial Design and Simplex Optimization to Improve Analytical Performance of In Situ Film Electrodes

This work presents a systematic approach to determining the significance of the individual factors affecting the analytical performance of in-situ film electrode (FE) for the determination of Zn(II), Cd(II), and Pb(II). Analytical parameters were considered simultaneously, where the lowest limit of quantification, the widest linear concentration range, and the highest sensitivity, accuracy, and precision of the method evidenced a better analytical method. Significance was evaluated by means of a fractional factorial (experimental) design using five factors, i.e., the mass concentrations of Bi(III), Sn(II), and Sb(III), to design the in situ FE, the accumulation potential, and the accumulation time. Next, a simplex optimization procedure was employed to determine the optimum conditions for these factors. Such optimization of the in situ FE showed significant improvement in analytical performance compared to the in situ FEs in the initial experiments and compared to pure in situ FEs (bismuth-film, tin-film, and antimony-film electrodes). Moreover, using the optimized in situ FE electrode, a possible interference effect was checked for different species and the applicability of the electrode was demonstrated for a real tap water sample.

In the vast majority of cases, in order to achieve optimized conditions, trial-and-error experiments are performed. By doing so, the term optimization is questionable. The so-called optimization is performed by changing one factor while maintaining the others at a certain value to obtain a better analytical response. After getting a better response for a certain factor value (the one that was changed) than that for the initial experiment, the obtained value is then maintained, and the other factors are optimized in the same manner. This procedure is a one-by-one optimization process without the use of a model and usually does not lead to the optimum but only local improvement. Another aspect that needs to be considered is the response. Most frequently a better analytical performance is deemed to have been achieved when a higher stripping peak is obtained. However, the latter would improve the sensitivity (the slope in the case of methods with a linear response) and most likely the limit of

Experimental
In this work, the in-situ FEs were named by the term XBiYSnZSb, where X, Y, and Z represent the mass concentrations of Bi(III), Sn(II), and Sb(III) in solution to form an in situ FE, respectively. For example, the term 0.60Bi0.80Sn0.30Sb stands for the in situ FE where the 0.1 M acetate buffer solution contained 0.60 mg/L Bi(III), 0.80 mg/L Sn(II), and 0.30 mg/L Sb(III). In cases where the in situ FE was designed in a solution that did not require at least one of the three mentioned ions, the ion that was missing in solution was not included in the designation (e.g., 0.59Bi0.10Sn as no Sb(III) was employed to form the in situ FE). A solution of 0.1 M acetate buffer was used as a supporting electrolyte in all SWASV measurements presented herein.
The real tap water sample was obtained in the laboratory (drinking water). Using this water, a 0.1 M acetate buffer solution was prepared in the same manner as for the model 0.1 buffer solution, except for the usage of tap instead of ultrapure water.

Electrochemical Measurements
All potentials reported in this work refer to the Ag/AgCl(saturated KCl) reference electrode. A platinum wire was used as a counter electrode and a glassy carbon electrode, GCE (a disc with a diameter of 3.0 mm, sealed in Teflon), served as the working electrode (Cat. No. 6.1204.300). Measurements were performed in an electrochemical cell and the volume of the solution for measurements was 20.0 mL (before the addition of the solutions of standard). The cell and the electrodes were supplied by Metrohm (Herisau, Switzerland). The electrochemical measurements were carried out at room temperature using a potentiostat/galvanostat supplied by PalmSens (PalmSens, Houten, the Netherlands), model PalmSens3 EIS. Measurements were controlled with PSTrace 5.6 software (PalmSens).
Before every electrochemical measurement, the GCE surface was polished using 0.05 µm Al 2 O 3 (Buehler, IL, USA). Then, the electrode was rinsed with ultrapure water, followed by ultrasound cleaning in ultrapure water for 1 min. After the ultrasound cleaning, the electrode was rinsed with ultrapure water and immersed in 15 wt.% HCl for approximately 10 min. A potential of 0.600 V was applied to further perform chemical/electrochemical cleaning. Then, the GCE was thoroughly rinsed with ultrapure water and gently wiped with a paper towel, without touching the active GCE surface. The adequacy of every preparation procedure before the SWASV experiments was tested with a hexacyanoferrate system and cyclic voltammetry, as explained previously [22]. SWASV measurements were performed at different E acc and t acc , as explained below, and using a 50 mV amplitude, a 4 mV potential step, and a frequency of 25 Hz. The equilibration time was always 15 s. During the accumulation and cleaning steps the solution was stirred at approximately 300 rpm, whereas the solution was not stirred during the equilibration and measurement. After the voltammogram measurement, a potential of 0.600 V was applied for 30 s to remove possible residual metals from the accumulation step. All SWASV measurements were performed in 0.1 M acetate buffer solution at pH 4.5 and all solutions were not deoxygenated.

Evaluation of the Performance of the SWASV Pethod
In general, the desire is always to determine the analytical method with the lowest limit of quantification (LOQ) and the lowest limit of detection (LOD), the highest sensitivity (herein represented by the slope of the calibration curve as the methods showed a linear response with a change in concentration), the highest precision of the method (the lowest relative standard deviation, RSD, for the replicate measurements), the highest accuracy (the best recovery, Re, i.e., the closest to 100.0%), and the widest linear concentration range. Based on the above-mentioned, the performance of the SWASV method was evaluated with these five different analytical parameters, i.e., the LOQ, the width of the linearity range, the slope of the calibration curve, the RSD (obtained from the precision of the method), and the difference of the Re relative to 100.0% (|100.0%−Re|). These analytical parameters are given in Equation (1) to obtain a value for the optimization criterion (OC). As the LOQ was included in this evaluation, the LOD was not considered in the OC calculation as the LOD and LOQ are very similar analytical properties (of course, not the same) and due to that, this property was not considered twice (if the LOQ is at a low concentration, then the LOD is also at a low concentration). All analytical parameters for OC evaluation were measured at least six times (also the method linearity; only three are shown in Figure 1 and in the figures in the Supplementary Materials) and the values were checked for possible outliers using Dixon's and Grubb's statistical test at 95% confidence [29]. If detected, they were discarded. In the case of the LOD and LOQ, the modus value was reported among all measurements.  Figure g) shows the increase in stripping peaks with increasing concentration of the analytes (simultaneously). The full symbols in a,c,e) characterize the linear concentration range, whereas the empty symbols characterize concentrations above and below the linear concentration range.
The higher the OC value, the better is the analytical performance of the method. As a wider linear concentration range and the highest sensitivity is desired, the terms describing these analytical parameters are in the numerator of Equation (Error! Reference source not found.). On the other hand, as the lowest RSD, the lowest LOQ, and the Re values closest to 100.0% are desired, these parameters are given in the denominator of Equation (Error! Reference source not found.). Because the Re can be lower or higher than 100.0%, the [100.0% -Re] term is expressed in absolute values.
In the present case, three analytes were determined simultaneously (Zn(II), Cd(II), and Pb(II)), and therefore every analyte has its own OC. As the electrochemical method was considered for the simultaneous determination of all these analytes, a combined OC should be employed in order to include the analytical properties of all the analytes simultaneously. This combined OC (OCcombined) was determined as a product of every OC for Zn(II), Cd(II), and Pb(II), as given in Equation (Error! Reference source not found.), and it served as a value to determine which in situ FE performs better.
The Re value and RSD (for the precision of the method) for all three analytes were determined at the same concentration, i.e., at the lowest concentration where all three analytes were within their , and (f) Pb(II). The measurements were performed using 1.00Bi0.60Sn0.34Sb in 0.1 M acetate buffer using t acc = 100 s and E acc = −1.380 V. Figure (g) shows the increase in stripping peaks with increasing concentration of the analytes (simultaneously). The full symbols in a,c,e) characterize the linear concentration range, whereas the empty symbols characterize concentrations above and below the linear concentration range.
The higher the OC value, the better is the analytical performance of the method. As a wider linear concentration range and the highest sensitivity is desired, the terms describing these analytical parameters are in the numerator of Equation (1). On the other hand, as the lowest RSD, the lowest LOQ, and the Re values closest to 100.0% are desired, these parameters are given in the denominator of Equation (1). Because the Re can be lower or higher than 100.0%, the [100.0% -Re] term is expressed in absolute values. OC analyte = (the width of the linear concentration range) analyte ·(calibration curve slope) analyte LOQ analyte ·RSD analyte · 100.0% − Re(%) analyte (1) In the present case, three analytes were determined simultaneously (Zn(II), Cd(II), and Pb(II)), and therefore every analyte has its own OC. As the electrochemical method was considered for the simultaneous determination of all these analytes, a combined OC should be employed in order to include the analytical properties of all the analytes simultaneously. This combined OC (OC combined ) was determined as a product of every OC for Zn(II), Cd(II), and Pb(II), as given in Equation (2) and it served as a value to determine which in situ FE performs better.
The Re value and RSD (for the precision of the method) for all three analytes were determined at the same concentration, i.e., at the lowest concentration where all three analytes were within their linear concentration ranges simultaneously (if not stated otherwise). It must be pointed out that the Re and RSD were determined by measuring the concentrations of the analytes, where the solution and electrode preparation was carried out every time anew, to test the right precision of the method. Frequently in the literature, RSD values are reported where the same solution is measured in sequence, which stands for the precision of the system (the latter is also reported below), which of course gives different RSD values than that for the precision of the method (the latter are higher or in the best possible case equal, but cannot be lower). Hereinafter, only the numerical values without units are reported for OC combined . Figure 1 shows an example of the linear concentration measurements, the corresponding change in the stripping peak potential, and the increase in stripping peak heights with an increase in the concentration of the analytes. These data for other electrodes that were tested are given in the Supplementary Materials.

Fractional Factorial Design
The influence of different factors on the SWASV analytical performance was investigated by means of a fractional factorial design. Five different factors were considered, i.e., γ Bi(III) (x 1 ), γ Sn(II) (x 2 ), γ Sb(III) (x 3 ), E acc (x 4 ), and t acc (x 5 ). The fractional factorial design was an extended full two-level factorial design with 3 factors (2 3 ). The levels for factors x 1 , x 2 , and x 3 correspond to a full two-level factorial design with 3 factors, whereas factors x 4 and x 5 are obtained by x 1 · x 2 = x 4 and x 1 · x 3 = x 5 , where (+ · + gives +, + · − gives −, and − · − gives +) in order to design the fractional factorial design. The fractional two-level factorial design with five factors is shown in Table 1 (+ stands for the factor when it is at the high level and -stands for the factor when it is at the low level). The most negative E acc was set at −1.500 V, as hydrogen evolution is significant at more negative potentials (an example of such hydrogen evolution is given in Figure 1g). The decision level for the concentration of the ions for the formation of the in situ FE was set to 0.50 mg/L, as this is a very common concentration used to form an in situ FE [1][2][3][30][31][32][33][34]. The decision level for the E acc was set at −1.350 V, as at potentials more positive than −1.200 V (which is the low level for this factor in Table 1) the accumulation of Zn(II) would be an issue (the Zn(II) stripping peak is at approximately −1.100 V). The decision level for the t acc was set to 55 s (60 s is a very common t acc [1][2][3][30][31][32][33][34] and therefore this value was included in the high level for t acc ). Table 1 shows the levels for every factor when they are at the high or low level.
Partial method validation by measuring the LOQ (also the LOD, but this was not included in the OC, as mentioned above), linear concentration range (and simultaneously the calibration curve's slope), RSD, and Re was performed for every in situ FE (the experimental variables are as given in the factorial design in Table 1) and the OC combined values were calculated for each in situ FE. The OC combined values served as a response for the factorial design. The obtained OC combined values, the factor impact, and the critical values are presented in Table 1. The assessment of whether one factor has a significant impact on the analytical property is determined as factor impact = OC combined + − OC combined − , where the OC combined + and OC combined − are the average values of OC combined when the factor is at the high and low level, respectively. The impact of the factor is significant when factor impact > critical value = t 0.05, n OC combined + + n OC combined − − 2 ·s pooled · 1 n OC combined + + The term s pooled stands for the pooled standard deviation. The Student's t-value at 95% confidence is t 0.05, n OC combined + + n OC combined − − 2 and is, in the present case, determined with 6 degrees of freedom (as 4 factors are at the high level and 4 factors are at the low level). The term s 2 OC combined + represents the variance of the OC combined values when the factor is at the high level (for example, in the case of the γ Bi(III) factor these OC combined values are 0.002056, 0.000142, 0.000056, and 0.000243). On the other hand, s 2 OC combined − is the variance of the OC combined values when the factor is at the low level. The terms n OC combined + and n OC combined − are the numbers of cases when the factor is either at the high or low level, respectively (in this case, both are 4) [29].
As given in Table 1, no factor alone (γ Bi(III), γ Sn(II), γ Sb(III), E acc , and t acc ) has a significant influence on the OC combined value, i.e., on the simultaneous combined analytical performance of all three analytes. Based on that, we can conclude that all these factors have an influence simultaneously and no single factor prevails. Therefore, optimizing only one factor (e.g., the optimization of t acc is usually reported in the literature) but holding the other factors at a certain value would not lead to optimized conditions, but only to a local improvement. On the other hand, optimizing the system to obtain the global optimum calls for the optimization of all five factors simultaneously. In this study, the simplex optimization procedure was employed.
For comparison, a significance impact evaluation of a single factor on one analytical parameter was performed and the results are given in Table 2. In these cases, the response in the fractional factorial design was a product or sum of the analytical parameters of all three analytes simultaneously instead of the OC combined (everything else is the same as in Table 1). This evaluation is given only for comparison since the main purpose of this study is to improve the five main analytical parameters simultaneously. Table 2 shows that only t acc has a significant impact on the LOQ if the response is taken as a product of the individual LOQs for the three analytes. On the other hand, if the response is taken as the sum of the analytes' individual analytical parameters, only the t acc has a significant impact on the width of the linear concentration range (linearity in Table 2), LOQ, sensitivity (slope in Table 2), and precision of the methods (the RSDs in Table 2). However, as will be shown below, it would be misleading if only t acc were optimized as the other four factors changed significantly at the end of the simplex optimization. Table 2. The significance of factors on an individual analytical parameter (no or yes is the answer if the factor has a significant impact on the given response). The RSD in % was defined as the precision of the method.

Response
γ Bi(III) γ Sn(II) γ Sb(III) E acc t acc response as a combination of the product OC LOD = linearity Zn(II) · linearity Cd(II) · linearity Pb (II) No No response as a combination of the sum OC LOD = linearity Zn(II) + linearity Cd(II) + linearity Pb (II) No

Simplex Optimization
In the simplex optimization procedure, the OC combined value was used as the optimization criterion. A higher OC combined value represents an improved value. The same factors were considered as in the factorial design given above. As five factors were optimized, six initial experiments were needed to start the optimization (simplex optimization requires one experiment more than the number of factors). As the OC combined values were already determined for eight experiments, six of the experiments with the highest OC combined values were employed in the simplex optimization. Because two more experiments were performed in the factorial design than the required number of experiments for the simplex optimization, two experiments with the lowest OC combined values (the experiments marked with numbers 5 and 6 in Tables 1 and 2) were discarded from the optimization procedure.
In using the factors from each experiment, in order to determine each subsequent experiment in the simplex optimization, a reflected point (designated with the letter B i , representing the best reflected point -the best predicted experiment to perform that would give the highest OC combined value) was calculated. The B i point was determined by the reflection of the worst point W i (the experiment with the lowest OC combined value) through the centroid (CEN) point, which is calculated from all points except W i . The subscript i represents the number of simplex reflections. The initial simplex procedure was carried out with an α value of 1, i.e., the B i value was calculated as B i = (1+α)·CEN -α·W i . When performing the final four simplex reflections, the α value was reduced from 1 to 0.25 as the simplex approached the optimum.
During the optimization, the boundary conditions were established because in some cases the factor values for the next experiment were determined at values that are impossible or can cause issues. The boundary condition was set to −1.500 V for E acc if the calculated value predicted more negative E acc than −1.500 V, since the evolution of hydrogen becomes significant at more negative potentials than −1.500 V. The latter was applied for B 2 and B 5 . In the case of B 7 and B 9 , the negative mass concentration of Sb(III) was calculated and thus the boundary condition of 0.00 mg/L was applied.
For experiments B 8 , B 10 , and B 13 , the determined OC combined values were lower than the OC combined values for W 8 , W 10 , and W 13 . In these cases, as required in the simplex procedure, experiments labelled W 8 , W 10 , and W 13 were not considered as the worst experiments, whereas the experiments with the second worst (lowest) OC combined value were set as W i in the simplex procedure (experiments labelled W 9 , W 11 , and W 14 , were determined as new W i experiments in these cases). On that basis, new CEN and new B i (B 9 , B 11 , and B 14 ) were calculated followed by the simplex optimization procedure. Table 3 shows the sequence of the simplex optimization procedure and the experiments performed. The optimum was reached using the 1.00Bi0.60Sn0.34Sb in situ FE (experiment B 12 ), where the best analytical parameters for the simultaneous determination of Zn(II), Cd(II), and Pb(II) were determined. Therefore, the in situ FE at the optimum condition was the in situ FE using E acc = −1.380 V, t acc = 100 s, γ Bi(III) = 1.00 mg/L, γ Sn(II) = 0.60 mg/L, and γ Sb(III) = 0.34 mg/L. The simplex optimization was concluded as the OC combined values for the B 13 and B 14 were significantly lower than for B 12 [35]. Successful optimization of this in situ FE is clearly noted for B 12 as the OC combined value reached 0.111153. For comparison, the best performing in situ FE before the optimization procedure (in the factorial design) had an OC combined value of 0.002056. Therefore, this optimization increased the OC combined value by two orders of magnitude.   As mentioned above, the best in situ FE was 1.00Bi0.60Sn0.34Sb. In the partial method validation for Cd(II) and Pb(II), Re values of 98.3% and 104.5% were obtained, whereas the RSD values (the precision of the method) were 9.5% and 8.7%, respectively. For Zn(II), a lower accuracy (Re = 50.3%) and precision of the method (RSD = 36.1%) were determined. In order to increase these analytical performance features (the accuracy and precision of the method for Zn(II)), a higher weighting factor for |Re-100.0%| Zn(II) and RSD Zn(II) can be added in the OC combined calculation. However, this is beyond the scope of this investigation and could be a subject for future research.   (Figure 2b). In order to accept a linear concentration range for a certain electrode, two criteria needed to be satisfied, i.e., R 2 > 0.995 and QC < 5.00 % (R is the correlation coefficient and QC is the quality coefficient [29,36]). The electrode No. for the simplex procedure in Figure 2b represents i, when B i was measured.
The width and the range of the linearity for all analytes depend on the in situ FE used. Among the three analytes, in general, the widest linear concentration range was determined for Pb(II), followed by Cd(II), whereas the linear concentration ranges for Zn(II) were the narrowest (for Zn(II), this applies for all in situ FEs apart from 1.15Bi1.22Sn0.57Sb, where the linear concentration range for Zn(II) was wider than that for Cd(II)-electrode No. 5 in Figure 2b). The widest linear concentration range for Pb(II) and Cd(II) was determined in the case of 0.80Bi0.30Sn0.20Sb (electrode No. 4 in Figure 2a), and the widest linear concentration range for Zn(II) was determined for 1.31Bi1.08Sn0.44Sb (electrode No. 8 in Figure 2b).
In certain cases, two linear concentration ranges for Zn(II) and Cd(II) developed (one such example for Cd(II) is given in Figure 1c), whereas for 1.31Bi1.08Sn0.44Sb, even three linear concentration ranges were present for Zn(II) ( Figure S11 in the Supplementary Materials). In the case of Cd(II), a double current peak for Cd(II) developed. First, the peak at more positive potentials predominates at lower Cd(II) concentrations. With an increase in Cd(II) concentration, the peak at more negative potentials increased, as presented in Figure 3. This shift was previously ascribed to the increased size of the deposited nanoparticles on the surface of the electrode [25,37,38]. Based thereon, also more than one slope value is reported in Figure 4).
For all in situ FEs tested, the three stripping peaks were well separated from each other and from the stripping peaks for the ions that form the in situ FE. Therefore, all electrodes had good selectivity for the determination of these three analytes (one example is given in Figure 1g; more examples are given in the Supplementary Materials).
Sensors 2020, 20, x FOR PEER REVIEW 9 of 22 of Cd(II), a double current peak for Cd(II) developed. First, the peak at more positive potentials predominates at lower Cd(II) concentrations. With an increase in Cd(II) concentration, the peak at more negative potentials increased, as presented in Figure 3. This shift was previously ascribed to the increased size of the deposited nanoparticles on the surface of the electrode [25,37,38]. Based thereon, also more than one slope value is reported in Figure 4).
For all in situ FEs tested, the three stripping peaks were well separated from each other and from the stripping peaks for the ions that form the in situ FE. Therefore, all electrodes had good selectivity for the determination of these three analytes (one example is given in Figure 1g; more examples are given in the Supplementary Material).   concentration.
As mentioned above, sensitivity was evaluated based on the calibration curve's slope. Figure 4 shows the change in sensitivity (the calibration curve slope values) for the different in situ FEs that were employed in the factorial design (Figure 4a-c) and in the simplex optimization procedure (the electrode No. for the simplex procedure in Figure 4d-f represents i, when Bi was measured). By comparing the performance of the in situ FEs that were tested in the factorial design with the in situ FEs tested in the simplex optimization, most of the electrodes show a higher sensitivity for the latter. The LOD is the lowest concentration where the signal can be confidently distinguished from the noise, and the LOQ is the lowest concentration at which quantification is possible. On that basis, the LOD was determined as the concentration at which the signal-to-noise (S/N) ratio was equal or higher than 3.00 (but not exceeding 10.00), whereas the LOQ is the concentration at which the S/N ratio was equal or higher than (but close to) 10 [17,24]. Signal S is the stripping peak's height and the noise N is the baseline noise (the difference between the highest and the lowest measured point on the baseline). As these values were determined experimentally, the LOQ is not always exactly 3-times (or 3.3-times) higher than the LOD. Table 4 summarizes the obtained LOD and LOQ values. In general, the lowest LOD and LOQ values were determine for Cd(II). The simplex optimization procedure did not have a significant influence on the LOD and LOQ for these in situ FEs. These values were in the same range as reported previously [22,24,39]. As mentioned above, sensitivity was evaluated based on the calibration curve's slope. Figure 4 shows the change in sensitivity (the calibration curve slope values) for the different in situ FEs that were employed in the factorial design (Figure 4a-c) and in the simplex optimization procedure (the electrode No. for the simplex procedure in Figure 4d-f represents i, when B i was measured). By comparing the performance of the in situ FEs that were tested in the factorial design with the in situ FEs tested in the simplex optimization, most of the electrodes show a higher sensitivity for the latter.
Sensors 2020, 20, x FOR PEER REVIEW 10 of 22 Figure 3. The change in the shape of the Cd(II) stripping peak with an increase in Cd(II) concentration.
As mentioned above, sensitivity was evaluated based on the calibration curve's slope. Figure 4 shows the change in sensitivity (the calibration curve slope values) for the different in situ FEs that were employed in the factorial design (Figure 4a-c) and in the simplex optimization procedure (the electrode No. for the simplex procedure in Figure 4d-f represents i, when Bi was measured). By comparing the performance of the in situ FEs that were tested in the factorial design with the in situ FEs tested in the simplex optimization, most of the electrodes show a higher sensitivity for the latter. The LOD is the lowest concentration where the signal can be confidently distinguished from the noise, and the LOQ is the lowest concentration at which quantification is possible. On that basis, the LOD was determined as the concentration at which the signal-to-noise (S/N) ratio was equal or higher than 3.00 (but not exceeding 10.00), whereas the LOQ is the concentration at which the S/N ratio was equal or higher than (but close to) 10 [17,24]. Signal S is the stripping peak's height and the noise N is the baseline noise (the difference between the highest and the lowest measured point on the baseline). As these values were determined experimentally, the LOQ is not always exactly 3-times (or 3.3-times) higher than the LOD. Table 4 summarizes the obtained LOD and LOQ values. In general, the lowest LOD and LOQ values were determine for Cd(II). The simplex optimization procedure did not have a significant influence on the LOD and LOQ for these in situ FEs. These values were in the same range as reported previously [22,24,39]. The LOD is the lowest concentration where the signal can be confidently distinguished from the noise, and the LOQ is the lowest concentration at which quantification is possible. On that basis, the LOD was determined as the concentration at which the signal-to-noise (S/N) ratio was equal or higher than 3.00 (but not exceeding 10.00), whereas the LOQ is the concentration at which the S/N ratio was equal or higher than (but close to) 10 [17,24]. Signal S is the stripping peak's height and the noise N is the baseline noise (the difference between the highest and the lowest measured point on the baseline).
As these values were determined experimentally, the LOQ is not always exactly 3-times (or 3.3-times) higher than the LOD. Table 4 summarizes the obtained LOD and LOQ values. In general, the lowest LOD and LOQ values were determine for Cd(II). The simplex optimization procedure did not have a significant influence on the LOD and LOQ for these in situ FEs. These values were in the same range as reported previously [22,24,39]. Table 4. The limit of detection (LOD) and limit of quantification (LOQ) values determined during the factorial design and simplex optimization. S/N ≥ 3.00 and ≥10.00 were taken into consideration for LOD and LOQ determination, respectively.

Electrode
No. The precision of the system is reported in Table 5 as the RSD obtained for 12 consecutive measurements of the Zn(II), Cd(II), and Pb(II) stripping signals (peak heights) in the same solution. Therefore, this precision is based on the peak height's determination and not the actual concentration (the latter is commonly determined using the multiple standard addition method). The concentrations at which measurements for the precision of the system were performed correspond to the lowest concentration possible where all three analytes were within their linear concentration range. It was possible to perform the latter for all in situ FEs, apart from 0.30Bi0.30Sn0.60Sb, as the higher limit of the linear concentration range for Zn(II) was at a lower concentration than the lower limit of the second linear concentration range for Cd(II) and close to the higher limit of the first linear concentration range for Cd(II) (see Figure 2b for electrode No. 7). For 0.30Bi0.30Sn0.60Sb, the concentration of the lower limit of the linear concentration range for Zn(II) and the concentration of the lower limit of the linear concentration range for Cd(II) (this was also the concentration of Pb(II)) were tested. The same concentrations as given in Table 5 were also employed to determine the precision of the method and the Re that were incorporated in the OC combine value determination. It would, however, be possible to determine the concentration of all three analytes at 72.2 µg/L using 0.30Bi0.30Sn0.60Sb (as reported in Figure 2b for electrode No. 7), but the concentration determination was performed using the multiple standard addition method, where the linear concentration range of the method needs to be above the value that is being determined. Concentrations were needed to determine the precision of the method and the Re (as mentioned above, they were incorporated into OC combined value determination). Table 5. RSD values, representing the precision of the system obtained during the factorial design and simplex optimization procedure.

Electrode No. Electrode Designation Zn(II) Cd(II) Pb(II) γ [µg/L] RSD [%] RSD [%] RSD [%]
Factorial Design Regarding the vast majority of in situ electrodes, the precision of the system was satisfactory as the RSD values were lower than 20.0%. RSD ≤20.0% is usually the value at which the analytical method is deemed to be precise [40]. However, the 0.64Bi0.83Sn0.01Sb for Zn(II), 0.58Bi0.49Sn0.38Sb for Pb(II), and 1.13Bi0.72Sn0.23Sb for Cd(II) reported RSD values that were above 20.0%, implying the non-precision of the system. On the other hand, it has to be pointed out that the RSD values for the best performing electrode (electrode No. 12 from the simplex optimization) had very low RSD values, i.e., 8.1% for Zn(II), 2.0% for Cd(II), and 7.6% for Pb(II).
It has to be pointed out that the analytical performance of the in situ FE was evaluated by a combination of different analytical parameters for the three analytes (to obtain OC combined ), and not sensitivity and/or linearity and/or the LOQ alone, as reported above, and the explanation in this section is given only to show how these parameters change during the optimization procedure.

Comparison of the Optimized In Situ FE with the Pure In Situ FEs
The in situ FE design using different ions is reasonable if this combination has better analytical performance compared to the in situ FE design using one ion alone. On that basis, the analytical performance of the optimized 1.00Bi0.60Sn0.34Sb was compared with the pure in situ FE formed using Bi(III) or Sn(II) or Sb(III) alone, by designing 1.94Bi, 1.94Sn, and 1.94Sb in situ FEs. The same partial method validation was performed as above at a mass concentration of 1.94 mg/L for Bi(III) or Sn(II) or Sb(III), which represents the sum of the mass concentrations of the individual ions to design 1.00Bi0.60Sn0.34Sb, i.e., γ Bi(III) = 1.00 mg/L, γ Sn(II) = 0.60 mg/L, and γ Sb(III) = 0.34 mg/L. For pure in situ FEs the same E acc = −1.380 V and t acc = 100 s were employed as in the case of 1.00Bi0.60Sn0.34Sb. The results are summarized in Table 6. The recovery and precision of the method was tested at the same concentration for all three analytes (for the same reason as mentioned above) for all in situ FEs apart from the 1.94Sb as the upper limit of the linear concentration range for Zn(II) was at a lower concentration than the lower limit of the linear concentration range for Cd(II) and Pb(II). The LOD and LOQ values for Zn(II), Cd(II), and Pb(II) are similar for 1.00Bi0.60Sn0.34Sb and 1.94Bi. Higher LOD and LOQ values were determined using 1.94Sn, especially for Zn(II). The lowest LOD and LOQ values for Pb(II) were measured for 1.94Sb. On the other hand, using the latter in situ FE, the determination of the LOD and LOQ for Cd(II) was an issue due to the high background contribution in the potential range where the Cd(II) stripping signal occurs (see the insert in Figure 5). When a peak developed that can be clearly distinguished from the baseline, the S/N value was significantly higher than 10 and the reported value can no longer represent the LOQ (and of course not the LOD). The same issue occurred in the case of 1.94Sn and that is why the LOD and LOQ values for these two in situ FEs are not reported in Table 6. On that basis, 1.94Sn and 1.94Sb are less suitable for Cd(II) determination. The 1.00Bi0.60Sn0.34Sb has the widest linear concentration range and sensitivity for Zn(II). It also has the best accuracy (Re) and precision of the method (RSD) for Cd(II) and Pb(II) among all in situ FEs tested. Using 1.00Bi0.60Sn0.34Sb, the lowest concentrations can be quantified for Cd(II) and Pb(II). The accuracy and precision of the method for the Zn(II) determination are the only parameters that are not satisfactory for this electrode.
As all analytical parameters needed to calculate the OCcombined could not be determined with 1.94Sn and 1.94Sb, the OCcombined values for these two in situ FEs are not given in Table 6. On the other hand, the OCcombined value for 1.94Bi was determined to be 0.009410. BiFE is considered to be one of the benchmarks regarding in situ FEs in the electroanalysis of heavy metal traces [1,8,12,[41][42][43][44][45][46][47]. Therefore, the importance of this work is signified with the OCcombined value for 1.00Bi0.60Sn0.34Sb, which is at least one order of magnitude better (higher), thus demonstrating the improved design of the in situ FE when using this combination of ions to form an in situ FE compared to the use of only one ion to form a pure in situ FE.

Interference Study
The possible interference effect of different species when present in solution on the Zn(II), Cd(II), and Pb(II) stripping peaks were tested in 0.1 M acetate buffer solution. These species can be present in the water and can potentially increase or decrease the analyte's stripping peaks and are considered below as potential interferents. The influence of Cu(II), Na(I), Mg(II), As(III), Fe(II), Ca(II), K(I), Cl¯, SO4 2¯, and NO3¯ at three different ratios relative to the mass concentration of the analytes was tested, i.e., 1:1, 1:10, and 1:100 [48]. The concentration of all three analytes was 135.7 μg/L.
The interference effect was determined by measuring the analyte's stripping peak height with and without the interferent present. The influence of the interferent at a certain analyte:interferent ratio was calculated as [% = 100% (Δiinterferent-Δianalite)/Δianalite], where Δianalite is the analyte's average stripping peak height (3 replicate measurements) and Δiinterferent is the analyte's average stripping peak height in the presence of the interferent (3 replicate measurements). The calculated values are given in Table 7, where positive and negative values represent the increase and decrease in the analyte's stripping peak height in the presence of the interferent. Table 7. The influence of different species as possible interferents on the determination of the analytes' stripping peaks using 1.00Bi0.60Sn0.34Sb (Eacc = −1.380 V, tacc = 100 s) in 0.1 M acetate buffer The 1.00Bi0.60Sn0.34Sb has the widest linear concentration range and sensitivity for Zn(II). It also has the best accuracy (Re) and precision of the method (RSD) for Cd(II) and Pb(II) among all in situ FEs tested. Using 1.00Bi0.60Sn0.34Sb, the lowest concentrations can be quantified for Cd(II) and Pb(II). The accuracy and precision of the method for the Zn(II) determination are the only parameters that are not satisfactory for this electrode.
As all analytical parameters needed to calculate the OC combined could not be determined with 1.94Sn and 1.94Sb, the OC combined values for these two in situ FEs are not given in Table 6. On the other hand, the OC combined value for 1.94Bi was determined to be 0.009410. BiFE is considered to be one of the benchmarks regarding in situ FEs in the electroanalysis of heavy metal traces [1,8,12,[41][42][43][44][45][46][47]. Therefore, the importance of this work is signified with the OC combined value for 1.00Bi0.60Sn0.34Sb, which is at least one order of magnitude better (higher), thus demonstrating the improved design of the in situ FE when using this combination of ions to form an in situ FE compared to the use of only one ion to form a pure in situ FE.

Interference Study
The possible interference effect of different species when present in solution on the Zn(II), Cd(II), and Pb(II) stripping peaks were tested in 0.1 M acetate buffer solution. These species can be present in the water and can potentially increase or decrease the analyte's stripping peaks and are considered below as potential interferents. The influence of Cu(II), Na(I), Mg(II), As(III), Fe(II), Ca(II), K(I), Cl − , SO 4 2− , and NO 3 − at three different ratios relative to the mass concentration of the analytes was tested, i.e., 1:1, 1:10, and 1:100 [48]. The concentration of all three analytes was 135.7 µg/L. The interference effect was determined by measuring the analyte's stripping peak height with and without the interferent present. The influence of the interferent at a certain analyte:interferent ratio was calculated as [% = 100% (∆i interferent -∆i analite )/∆i analite ], where ∆i analite is the analyte's average stripping peak height (3 replicate measurements) and ∆i interferent is the analyte's average stripping peak height in the presence of the interferent (3 replicate measurements). The calculated values are given in Table 7, where positive and negative values represent the increase and decrease in the analyte's stripping peak height in the presence of the interferent. Cu(II) and Fe(II) had the greatest influence on the electrochemical determination of Zn(II), Cd(II), and Pb(II). In the case of both of these interferents, the intensity of all three analytes' stripping peaks decreased significantly even at a concentration ratio of 1:1. All three analytes' stripping peaks did not developed at a ratio of 1:100, except for the case of γ Cd(II) :γ Fe(II) = 1:100, where the Cd(II) stripping peak developed and its average stripping peak height decreased by 41.7% (Figure 6d and Table 7). The other species tested had a smaller effect on the analytes' average stripping peak heights (Table 7). Cu(II) and Fe(II) had the greatest influence on the electrochemical determination of Zn(II), Cd(II), and Pb(II). In the case of both of these interferents, the intensity of all three analytes' stripping peaks decreased significantly even at a concentration ratio of 1:1. All three analytes' stripping peaks did not developed at a ratio of 1:100, except for the case of γCd(II):γFe(II) = 1:100, where the Cd(II) stripping peak developed and its average stripping peak height decreased by 41.7% (Figure 6d and Table 7). The other species tested had a smaller effect on the analytes' average stripping peak heights (Table 7). The reason for the above mentioned interference effect can be due to the competitive adsorption of analytes and interferent ions in the case of binary or multicomponent alloy formation during the accumulation procedure [49]. For example, As(III), Sn(II), Sb(III), and Fe(II) were reported before to cause such an interferent effect [3,34,37,43,[50][51][52][53][54][55][56]. On the other hand, the successful alleviation of such an effect can be achieved with the addition of ferrocyanide ions [57][58][59][60]. It must also be pointed The reason for the above mentioned interference effect can be due to the competitive adsorption of analytes and interferent ions in the case of binary or multicomponent alloy formation during the accumulation procedure [49]. For example, As(III), Sn(II), Sb(III), and Fe(II) were reported before to cause such an interferent effect [3,34,37,43,[50][51][52][53][54][55]. On the other hand, the successful alleviation of such an effect can be achieved with the addition of ferrocyanide ions [56][57][58][59]. It must also be pointed out that As(III), Sn(III), and Sb(III) are usually not present in this tap water at such a high concentration and these tests represent a worse-case scenario.

Real Sample Analysis
Real sample analysis was performed with 1.00Bi0.60Sn0.34Sb. As mentioned above, this in situ FE has a high precision of the method and a high accuracy for Cd(II) and Pb(II) determination in the model 0.1 M acetate buffer solution. Based on that, a real sample analysis was performed for these two ions. The tap water sample did not show any stripping peak for Cd(II) or Pb(II) (Figure 7c). The tap water sample was then spiked with Cd(II) and Pb(II) to obtain a final solution of 39.3 µg/L Cd(II) and 135.7 µg/L Pb(II). Figure 7c shows that well-defined Cd(II) and Pb(II) stripping peaks were formed. The analysis was repeated five times and the average Re and RSD values were calculated (no outliers were detected using Dixon's and Grubb's tests [29]). To determine the concentration, the multiple standard addition method was employed. The average Re values for Cd(II) and Pb(II) were 83.7% and 88.9%, respectively. The RSD values (demonstrating the precision of the method) were 3.6% and 11.3% for Cd(II) and Pb(II), respectively. As Re was within the interval of 80.0-120.0% and RSD was lower than 20.0% for both analytes [40], it can be concluded that the developed in situ FE is accurate and precise for the determination of Cd(II) in Pb(II) in the real tap water sample.
Sensors 2020, 20, x FOR PEER REVIEW 16 of 22 out that As(III), Sn(III), and Sb(III) are usually not present in this tap water at such a high concentration and these tests represent a worse-case scenario.

Real Sample Analysis
Real sample analysis was performed with 1.00Bi0.60Sn0.34Sb. As mentioned above, this in situ FE has a high precision of the method and a high accuracy for Cd(II) and Pb(II) determination in the model 0.1 M acetate buffer solution. Based on that, a real sample analysis was performed for these two ions. The tap water sample did not show any stripping peak for Cd(II) or Pb(II) (Figure 7c). The tap water sample was then spiked with Cd(II) and Pb(II) to obtain a final solution of 39.3 μg/L Cd(II) and 135.7 μg/L Pb(II). Figure 7c shows that well-defined Cd(II) and Pb(II) stripping peaks were formed. The analysis was repeated five times and the average Re and RSD values were calculated (no outliers were detected using Dixon's and Grubb's tests [29]). To determine the concentration, the multiple standard addition method was employed. The average Re values for Cd(II) and Pb(II) were 83.7% and 88.9%, respectively. The RSD values (demonstrating the precision of the method) were 3.6% and 11.3% for Cd(II) and Pb(II), respectively. As Re was within the interval of 80.0-120.0% and RSD was lower than 20.0% for both analytes [40], it can be concluded that the developed in situ FE is accurate and precise for the determination of Cd(II) in Pb(II) in the real tap water sample.

Conclusions
A study of the influence of the mass concentration (γ) of three ions, Bi(III), Sn(II), and Sb(III) to form an in situ film electrode (FE), the accumulation potential (Eacc), and the accumulation time (tacc) on the analytical performance of the in situ FE was performed using a fractional two-level factorial

Conclusions
A study of the influence of the mass concentration (γ) of three ions, Bi(III), Sn(II), and Sb(III) to form an in situ film electrode (FE), the accumulation potential (E acc ), and the accumulation time (t acc ) on the analytical performance of the in situ FE was performed using a fractional two-level factorial design with five factors. The factorial design response was evaluated based on a combination of different analytical parameters, i.e., the limit of quantification (LOQ), sensitivity, linear concentration range, accuracy, and precision. Simultaneously, the lowest LOQ, the highest sensitivity, the highest precision of the method, the highest accuracy, and the widest linear concentration range signify better analytical performance. Based on that, an optimization criterion (OC analyte ) for the analyte was calculated. As the analysis of three ions was carried out simultaneously (Zn(II), Cd(II), and Pb(II)), the product of OC Zn(II) ·OC cd(II) ·OC Pb(II) was considered to be the combined OC, i.e., OC combined . A higher OC combined value means better analytical performance. The OC combined value was employed as a response for the factorial design. It was found that none of the factors alone (γ Bi(III) , γ Sn(II) , γ Sb(III) , E acc , and t acc ) had a significant influence of the final response. It was also found that only t acc had a significant influence on the individual analytical parameter, but not all simultaneously. Therefore, the OC combined is dependent on a combination of these factors as it changes when the factors change. On that basis, a simplex optimization procedure was carried out to find the optimized combination of the five factors mentioned above. The OC combined value was employed as the optimization criterion. Such optimization reported the best in situ FE (with the best analytical properties) with the following factors to design an in situ electrode; γ Bi(III) = 1.00 mg/L, γ Sn(II) = 0.60 mg/L, and γ Sb(III) = 0.34 mg/L, E acc = −1.380 V, t acc = 100 s. This in situ FE was named 1.00Bi0.60Sn0.34Sb. Using this electrode, the OC combined value was significantly higher than that for the benchmark Bi-film electrode.
As five parameters were considered for each analyte (15 together to calculate the OC combined ), the accuracy and precision of the method was somehow overshadowed and was lower for Zn(II). In order to increase these two analytical performance aspects for Zn(II), a higher weighting factor needs to be taken into account for these two parameters. The latter can be a subject of future research.
It was further demonstrated that 1.00Bi0.60Sn0.34Sb is selective for the determination of Zn(II), Cd(II), and Pb(II). The influence of the presence of different species (Cu(II), Mg(II), As(III), Fe(II), Ca(II), K(I), Cl − , SO 4 2− , and NO 3 − ) on the Zn(II), Cd(II), and Pb(II) stripping peak heights was tested to investigate a possible interference effect using 1.00Bi0.60Sn0.34Sb. Among these species, Cu(II) and Fe(II) can be considered to be interferents, whereas the other species had a minor effect or the effect was non-significant. Practical use of 1.00Bi0.60Sn0.34Sb was demonstrated for Cd(II) and Pb(II) analysis in a real tap water sample, where the precision of the method and accuracy was satisfactory for the determination of Cd(II) and Pb(II), i.e., RSD < 20.0% and recovery within an 80.0-120.0% interval. This work in particular demonstrates that one-by-one optimization (the change of one factor while holding the others at a certain value) does not lead to the optimal values (but only, if that, to local improvement) of the in situ FE with regard to analytical performance. To properly optimize the performance of in situ FEs, the factors to be optimized need to be optimized simultaneously.  Figure S4: Linear concentration ranges for (a) Zn(II), (c) Cd(II), and (e) Pb(II), and the stripping peak potentials for (b) Zn(II), (d) Cd(II), and (f) Pb(II). The measurements were performed using 0.80Bi0.30Sn0.20Sb in 0.1 M acetate buffer. Figure (g) shows the increase in stripping peaks with increasing concentration of the analytes (simultaneously). The full symbols in Figure (a,c,e) characterize the linear concentration range, whereas the empty symbols characterize concentrations above and below the linear concentration range. Figure S5: Linear concentration ranges for (a) Zn(II), (c) Cd(II), and (e) Pb(II), and the stripping peak potentials for (b) Zn(II), (d) Cd(II), and (f) Pb(II). The measurements were performed using 0.20Bi0.80Sn0.80Sb in 0.1 M acetate buffer. Figure g) shows the increase in stripping peaks with increasing concentration of the analytes (simultaneously). The full symbols in Figure (a,c,e) characterize the linear concentration range, whereas the empty symbols characterize concentrations above and below the linear concentration range. Figure S6: Linear concentration ranges for (a) Zn(II), (c) Cd(II), and (e) Pb(II), and the stripping peak potentials for (b) Zn(II), (d) Cd(II), and (f) Pb(II). The measurements were performed using 0.20Bi0.70Sn0.30Sb in 0.1 M acetate buffer. Figure  (g) shows the increase in stripping peaks with increasing concentration of the analytes (simultaneously). The full symbols in Figure (a,c,e) characterize the linear concentration range, whereas the empty symbols characterize concentrations above and below the linear concentration range.  Figure (g) shows the increase in stripping peaks with increasing concentration of the analytes (simultaneously). The full symbols in Figure (a,c,e) characterize the linear concentration range, whereas the empty symbols characterize concentrations above and below the linear concentration range. Figure S15: Linear concentration ranges for (a) Zn(II), (c) Cd(II), and (e) Pb(II), and the stripping peak potentials for (b) Zn(II), (d) Cd(II), and (f) Pb(II). The measurements were performed using 1.00Bi0.79Sn in 0.1 M acetate buffer. Figure (g) shows the increase in stripping peaks with increasing concentration of the analytes (simultaneously). The full symbols in Figure  (a,c,e) characterize the linear concentration range, whereas the empty symbols characterize concentrations above and below the linear concentration range. Figure S16: Linear concentration ranges for (a) Zn(II), (c) Cd(II), and (e) Pb(II), and the stripping peak potentials for (b) Zn(II), (d) Cd(II), and (f) Pb(II). The measurements were performed using 1.31Bi0.64Sn0.64Sb in 0.1 M acetate buffer. Figure (g) shows the increase in stripping peaks with increasing concentration of the analytes (simultaneously). The full symbols in Figure (a,c,e) characterize the linear concentration range, whereas the empty symbols characterize concentrations above and below the linear concentration range. Figure S17: Linear concentration ranges for (a) Zn(II), (c) Cd(II), and (e) Pb(II), and the stripping peak potentials for (b) Zn(II), (d) Cd(II), and (f) Pb(II). The measurements were performed using 0.59Bi0.10Sn in 0.1 M acetate buffer. Figure g) shows the increase in stripping peaks with increasing concentration of the analytes (simultaneously). The full symbols in Figure (a,c,e) characterize the linear concentration range, whereas the empty symbols characterize concentrations above and below the linear concentration range. Figure S18: Linear concentration ranges for (a) Zn(II), (c) Cd(II), and (e) Pb(II), and the stripping peak potentials for (b) Zn(II), (d) Cd(II), and (f) Pb(II). The measurements were performed using 1.08Bi0.19Sn0.41Sb in 0.1 M acetate buffer. Figure (g) shows the increase in stripping peaks with increasing concentration of the analytes (simultaneously). The full symbols in Figure (a,c,e) characterize the linear concentration range, whereas the empty symbols characterize concentrations above and below the linear concentration range. Figure S19: Linear concentration ranges for (a) Zn(II), (c) Cd(II), and (e) Pb(II), and the stripping peak potentials for (b) Zn(II), (d) Cd(II), and (f) Pb(II). The measurements were performed using 0.94Bi0.80Sn0.30Sb in 0.1 M acetate buffer. Figure (g) shows the increase in stripping peaks with increasing concentration of the analytes (simultaneously). The full symbols in Figure (a,c,e) characterize the linear concentration range, whereas the empty symbols characterize concentrations above and below the linear concentration range. Figure S20: Linear concentration ranges for (a) Zn(II), (c) Cd(II), and (e) Pb(II), and the stripping peak potentials for (b) Zn(II), (d) Cd(II), and (f) Pb(II). The measurements were performed using 0.94Bi0.67Sn0.28Sb in 0.1 M acetate buffer. Figure (g) shows the increase in stripping peaks with increasing concentration of the analytes (simultaneously). The full symbols in Figure  (a,c,e) characterize the linear concentration range, whereas the empty symbols characterize concentrations above and below the linear concentration range.