I just wanted to stop by to throw in my two sense regarding the provided solution. I’ve personally found that “when in doubt, make a new function”. I’m not sure if the real programmers among the user base agree with that or not, but as a novice, changing my mindset to use functions as a go-to solution for my problems helped me make Julia work for me.