implemented getClosestState by using a set sorted by size.
removed vector from code.