add comments and modify plot4.R