incorporated and annoted Hadley's frndly.R