Added an earlier python implementation from before for historical reasons.