Use iterator in populateRealTask function

    Also get rid of updating three different tables, because
    now the table entry struct encapsulates all info