Erik's version of the Phoenix code