In your for loop, "count" & "quantity" is not initialized.