Changed tables to a generator