Task2 modified

A bug with vector iterator fixed