Begin work to split gates into class files. May god forgive me for using not only one, but two global variables