deleted unnecessary variable, added some comments