renaming piece_count to count