Took out one for loop on tableExists method.