generalized logic : able to have multiple blocks for buying and selling