rewrite of piece class