tidied up, added dictionaries