added explanation from GridPattern.java