Added logic code to Piece class and all its subclasses