fix test code and finish bidding functions