math function and return values on boolean

Finally figured out return values in a boolean loop
started 3rd function(math)