Added residuals
Update NAMESPACE