Changed dicts to tuples
Add some debug messages