implemented cloning of objects