handle flat arrays