please add some comments here as below to make the code more easily readable