Implemented board pieces extraction function.