implementing dictionary generation