refined the comments
update code