few comments added to the code main code