Used dicts instead of lists of lists