Macro to write function with many conditionals

Great that that had been done. I will see if I understand that implementation.