removed unnecessary variable
added some comments