updated integration code