initial grains solution
refactor grains