dealing with tables of different sizes