Misunderstood the problem