@lorenzo Did you have an idea on how to get rid of these two loops?