arduino switch improvements