First working version of grains