completed DC3 algorithm and added tests