Updated function table generation code