Updated table to function