WIP -- mean generator code