Change variable based translation algorithm to term based (initial commit)