cosmetic changes to the code
switch not to !
switch {} to do/end