Remove piece_count global variable