added timing, rand_table functions