deleted unnecessary code, fixed bugs etc