remove unused vars
added some comments