corrected qty accumulation code

Found bug while studying Meeker&Escobar example 3.5