mandel example contributed by Stephen Phillips