Replaced vec::map function with the method equivalent.