Updated implementation to fit better with the Piece interface