vectorize solution