ported example, now compiles