More code to compile gates. Out connections table. Fixed some bugs