Add clone method. Not sure if it avoids the shallow copy problem.