I've made a generic implementation for the algorithm: https://github.com/franciscogaluppo/tiny-dc3 Might be useful.