Implemented invert for dictionary types