Implemented deepcopy for all the functions