implemented buy and sell