adding tests and removing the deepcopy