Code for the DANSE algorithms