save algorithm entirelly in contractform