Source code for apple generator prototype