Small changes in main function