Switch controls light on a nanoscale for faster information processing