Added example code file. Fixed recursion bug.