Functions like $monitor need to attach callbacks to array words if those words are to be monitored. Have the array hold all the callbacks for words in the array, under the assumption that the monitored words are sparse.