updated from R. Boyd's corrections