PPM algorithm realization