debugging foamgrid code