Primary solution that is wrong
Actual solution