Add dictionary data structure.
Fix memory errors.