error in implementing Caglioti's formula