Working CEDD code and spanner algorithm