changed table() data structure from a list to a dict