add edp
independent code from tangram1.3.9