updated Grain_Example.cpp