https://technicalsource9.medium.com/function-only-computing-first-element-of-array-used-as-input-43b50c508e2f