path memory and reduce