Changed working memory to HashSet, added missing line for removing rules
after they are successfully evaluated