replaced integrate routines with original implementation