chkbuy logic