Cleaned up some, not efficient at all now
Residuals in separate window
Selector for sample data
fixed back for current == 0