added operations on tables and sorting