added dynamic table generation