added getTotalOuputQuantity library function