if you use container more that once it's better to use typedef. For example, at line 42 you declare iterator for your set.