Changed generate connection element

Split into two functions: electron_gate_element and wait element

Used gate formalism