implemented integration function