Conditional statement using arrays