changed from swtich-statement to if-statement i views