work in progress, going to trim recursion
adding a rule dictionary