Solution, finally!