Add functions from diffmotif