Optimizing & Saving

Changing 2 dimensional arrays to Dictionary and lists
Integrating gates and links
Saving state in data structure