Well, I did an improved version of this for another user since he was having certain issues and inconsistencies...
Here it is in case anyone need it: