Replace vector with scoped_array for better performance (no needless fill)