Corrected integral function