uses switch case; added --std-out flag