buy_sell changes and preparation for ajax