rewrote some of the comments