added sell function and cases