Replaced Lists with Dictionary

The code is still very hard to read. Lots of cleaning necessary