changed to receive array of stocks