found a semiclean solution for part 2