rebuilds tables