added in resdiuals