reaction function