removed unnecessary codes & some fixes [2]