convert table array from function