commented some of the code