fix and expand dictionary routines