Tunning of a main function