New D algorithm
Merging changes