small fixes and added comments

removed unnecessary code
wrote comments