converted the parser to a function and to return a vector of cities