Implemented a "getPieces" method.