cleaned up table output and added tests for tables