Added input and output initiation for gates.