make the buy1 sell1 as common function