Fixed Bidding function

Thanks to bug reporting and fixing from Jeff