a method of manufacturing an electrically actuable switch and comprising : depositing a first electrode on a surface ; depositing an active layer or layers on top of said first electrode ; and depositing a second electrode on top of said active layer , wherein said step of depositing an active layer or layers is performed in an atmosphere into which a reactive gas is introduced , the partial pressure of the reactive gas being varied during the process so as to introduce dopants into the active layer in a concentration which varies across the active layer .