updated to use QTreeWidget instead of QTableWidget