making use of a magnetically operated switch