begin getPieces in utils