optimize capital after selling