Implemented some optimizations in integration methods