fixing and implementing a lot of stuff for cloning