distance script for erf