use dict in get_code