use another check function for arrays; correct relation between cs and dim