wrote clone feature from scratch instead of using deep_cloneable