fixed table order problem.

needs more testing. but looks accurate.