Vectorized solution