fixed some bugs with printing val counts