resid.nlme might work
added comments
fixed bootstrap fn