fixed the DIJ problem (same as last commit) in construction of normal equations.