reordering adding tables with basic tables first