modify code_to_buy logic