removes dead, misplaced and commented-out code