diffusion.cpp with output and without buggs