Finished sell function