Added more comments throughout.