added dictionaries and optionalized parameters