Added function: kind(n,ranks)