use array instead of else statement