Good job on implementing what I have suggested.
This is exactly how I would have done it.
There is a possible way to reduce an operation further, by replacing the Iterator/Aggregate to JSON, by using JavaScript with the CustomJS module. However this is advanced stuff and is for a different thread.
Hope this helps! Let me know if there are any further questions or issues.
— @samliew
P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!