I wonder if we can make this function var-free by using nested tail-recursive function that will generate those three variables? Or is it not worth it here, @xeno-by?