added routines for calculating point-environment averaging (PEA)