I still can't get rid of the double lookup. gonna need an OrderedDict for that.