added keys and gate