Added more comments about the code.