use array.indexOf instead of a super long condition statement