diff --git countryicons.module countryicons.module
old mode 100644
new mode 100755
index a39eaf3..19d5076
--- countryicons.module
+++ countryicons.module
@@ -28,6 +28,9 @@ function countryicons_theme() {
         'iconset' => 'shiny'
       ),
     ),
+    'countryicons_formatter_countryicons_flag' => array(
+      'arguments' => array('element' => NULL),
+    ),
   );
 }
 
@@ -157,3 +160,26 @@ function theme_countryicons_icon_sprite($code, $iconset = 'shiny') {
   drupal_add_css(drupal_get_path('module', 'countryicons') .'/iconsets/'. $iconset .'/' . $iconset .'.css');
   return'<ul class="countryicon countryicon-'. $iconset .'"><li class="countryicon-'. $code .'-'. $iconset .'"></li></ul>';
 }
+
+/**
+ * Implementation of hook_field_formatter_info().
+ */
+function countryicons_field_formatter_info() {
+  $formatters = array();
+  if (module_exists('purl')) {
+    $formatters['countryicons_flag'] = array(
+      'label' => t('Country flag'),
+      'field types' => array('text'),
+      'description' => t('Displays the flag of a country.'),
+    );
+  }
+  return $formatters;
+}
+
+/**
+ * Theme of Country flag formatter.
+ */
+function theme_countryicons_formatter_countryicons_flag($element) {
+  $output = theme_countryicons_icon($element['#item']['safe']);
+  return $output;
+}
