added programmatic db generation, added indices to db