Function createFromToArray