wrote some table tests, fixed actual bug