change 'Math' references to 'this' for consistency
create the factorial function with an immediate function