fix ppmapping's order
fix counting bug. hmm...