Implement naive repair functionality