Mistakenly pushed a bugged version before. This is the right one.
Tested and debugged