minor fixes to 2d

changed treeset to hashset, fied updatePairs, fixed printBoard