Choosing the number of components