Implmented a basic switch and controller