need to fill in scaterr function for mpifennel