patches functionality