rewrite the inhiret mechanism