added more table functionality fixed some small errors