fixed up table functions