adding some comments on this code