clean up on the dictionary and added the function for dictionary parsing