Working with Gates and Activation Functions