adds switches and attached events