count pieces and write to screen