Initial work on gate logic. Implementation of first gate.