switch case instead of if .. else if

merely a suggestion.