First cut of making PER encoding work