Suggest writing a test harness with as many variations of the three parameters as you can imagine. Then, posting the full MRE along with a block demonstrating its correct processing each of those test cases. OR, perhaps you meant to post
here as you seem uncertain as to whether this code actually does what it's meant to do. —
Fe2O3 51 secs ago