added code to build dict