removed unnecessary code and fixed bugs