moved creation of output list and used deepcopy again