Add the ppm generation

Tests have memory leaks at the moment.