Fix delta calculation and topo function creation