if loop and array