compute Cdelta in separate function