You're exposing a couple variables: `keys_pressed` and `test_string` globally. What if you put them on an object that also had the `charCompare` as a function? i.e.

```
var comparer = {
  keys_pressed: [],
  test_string: "Type these words",
  compare: function() {
     ...
  }
}