+ Adapted for fredholm kernel from old repo.