Add proper recursive algorithm for object cloning