reworked exercise 07 with inverse dictionary for increased efficiency.