code clean. add more comments.