Using sparsecounter instead of getpiece
Removed getpiece()