Main generating all tables