implementation of the automatic sorting of the components