Upgrade to new optfn that includes python 3 support