algorithms in D