better handling of variable definitions and defaults
a bit of makeFun() clean up.
modified warning message
turning off some debugging print statements
fixed logic error; added arguments; renamed variables