Same as previous solution using the "flag" package