kostas - added cloning function