Update TriangleSquare (java code)