fitted the code pip8 and changed the switch into an elif construct