min and max local functions are int, not double. Error found and diagnosed