Added code to determine if there are any tables to be made