working with D2
stupid bug in the java implementation