These changes make the code more efficient, since going trough an array with `forEach` is faster than iterating with a foor loop on every input change. Using `indexOf()` instead of `includes()` is faster as well.