How to adapt this code: Change isOneOfMyClasses to be all possible classes of messages inside a template. Change println() to addRow() Make another function to read the table and add missing indexes.