used switch case and hash instead of eturning a string