Updated to reflect changes in estimate.m
Returns residues; Refinement pushed to the end