Added more logic to generate the table