duplication method using (hash)map