Change to work with array

Doesn't work before, but wasn't recognized because of if's