code for lists and tables