Changed If-Else to Swich