exercise 15-6: use Vec and Str class that we defined in previous chapters instead of vector and string from standard library