added and rewrote comments