Changed the if-statment for writers to a switch instead