Added a cloneTable function