works on empty tables