modify buying logic