modified the dictionary display function