The subject invention concerns methods and compounds for inhibiting Shp2. In one embodiment, a compound of the invention has a chemical structure as shown in formula I or II:wherein X, Y, and Z are independently N or S R1 is cycloalkyl, heterocycloalkyl, aryl, or heteroaryl, any of which can be optionally substituted with one or more of halogen alkyl heteroalkyl —COOH —C(R3)3, wherein R3 can independently be any of —H or halogen or —OR4, wherein R4 can be any of H, alkyl, or heteroalkyl R2 is alkyl, alkylcarbonyl, heteroalkylcarbonyl, aryl, arylcarbonyl, heterocycloalkylcarbonyl, cycloalkylcarbonyl, or —C(O)NR6R7, any of which can be optionally substituted with one or more of halogen alkyl heteroalkyl carbonyl —OR4, wherein R4 can be —H, alkyl, or heteroalkyl —OH —C(R3)3, wherein R3 can independently be any of —H or halogen aryl, which can be substituted with one or more of halogen or —OR4 heterocycloalkyl or —C(O)OR5, wherein R5 can be —H or alkyl R6 and R7 are independently —H, alkyl, heteroalkyl, aryl, or heteroaryl and R′ is H or alkyl or a pharmaceutically acceptable salt or hydrate thereof.