rewritten Magician to make use of ES6 generators