deleted unnecessary code
added some comments