Fix compile
import charging code from jf kernel