addressed CR feedback, added comments, dropped unused code