Added logic to remove columns and rows