refactored and cleaned up examples; now includes recursive factorial
example