full buy and sell functionality