How are grains and grain structures formed?