port subtract process. references #29
ported subchain process. references #29