add function to convert a lst to a dict