add comments and remove unused code for previous commit