added get_piece method