Fixed the colour stuff
Implemented 3-input gates