Working with purchase and sale of stocks