just added some comments in the code