copy the canned routines in painless a bit more.