beginning of recursive grid system