New fast foci_plm function