comments added in main parts of code