removed unnecessary code and minor cosmetic changes