Added the function

Added the switch in the function that will generate numbers of the index