coments added and removed unnecessary code.