Correct Stock class investment function.