removed unnecessary codes & some fixes