main function introduced and commented