Works correctly :), though I saw the editorial and solution :(