puDistance function

Difference in layer stability p_unstable