updated comments throughout