A bit of refactoring (to better understand the code) + comments
We have something, but it doesn't work as expected