Added basic piece counting