improved grid initializer