add some comments
remove unused code