add buy_gold function