diff --git a/roadblock.info b/roadblock.info
index d0ac91a..513059c 100644
--- a/roadblock.info
+++ b/roadblock.info
@@ -1,3 +1,3 @@
 name = Roadblock
 description = Displays a chosen node once to all users, regardless of their point of entry to the site.
-core = 5.x
+core = 6.x
diff --git a/roadblock.install b/roadblock.install
index 2b23f7d..b770bb8 100644
--- a/roadblock.install
+++ b/roadblock.install
@@ -1,25 +1,41 @@
 <?php
+// $Id$
+/**
+ * @file
+ */
 
 /**
  * Implementation of hook_install().
  */
 function roadblock_install() {
-  switch ($GLOBALS['db_type']) {
-    case 'mysqli':
-    case 'mysql':
-      db_query("CREATE TABLE {roadblock_useragent} (
-        ua varchar(512) NOT NULL default ''
-      ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
-      break;
-  }
+  drupal_install_schema('roadblock');
+
   _roadblock_populate_useragent_table();
 }
 
 /**
+ * Implementation of hook_schema().
+ */
+function roadblock_schema() {
+  $schema['roadblock_useragent'] = array(
+    'description' => 'A list of user agents',
+    'fields' => array(
+      'ua' => array(
+        'type' => 'text',
+        'size' => 'medium',
+        'not null' => TRUE,
+        'default' => '',
+      ),
+    ),
+  );
+
+  return $schema;
+}
+/**
  * Implementation of hook_uninstall().
  */
 function roadblock_uninstall() {
-  db_query('DROP TABLE {roadblock_useragent}');
+  drupal_uninstall_schema('roadblock');
   variable_del('roadblock_enable');
   variable_del('roadblock_page');
   variable_del('roadblock_life');
diff --git a/roadblock.module b/roadblock.module
index 4cdcf1b..856b38f 100644
--- a/roadblock.module
+++ b/roadblock.module
@@ -1,34 +1,31 @@
 <?php
 
-/** 
+/**
  * @file
  */
 
 /**
  * Implementation of hook_help().
  */
-function roadblock_help($section) {
-  switch ($section) {
+function roadblock_help($path, $arg) {
+  switch ($path) {
     case 'admin/settings/roadblock':
       return '<p>'. t('Enable Roadblock and configure the roadblock page path, cookies lifetime and cron job.') .'</p>';
-   }
+  }
 }
 
 /**
  * Implementation of hook_menu().
  */
-function roadblock_menu($may_cache) {
+function roadblock_menu() {
   $items = array();
-  if ($may_cache) {
-    $items[] = array(
-      'path' => 'admin/settings/roadblock',
-      'title' => t('Roadblock'),
-      'description' => t('Enable Roadblock and configure the roadblock page path, cookies lifetime and cron job.'),
-      'callback' => 'roadblock_admin_page',
-      'access' => user_access('administer site configuration'),
-      'type' => MENU_NORMAL_ITEM
-    );
-  }
+  $items['admin/settings/roadblock'] = array(
+    'title' => 'Roadblock',
+    'description' => 'Enable Roadblock and configure the roadblock page path, cookies lifetime and cron job.',
+    'page callback' => 'roadblock_admin_page',
+    'access arguments' => user_access('administer site configuration'),
+    'type' => MENU_NORMAL_ITEM
+  );
   return $items;
 }
 
@@ -40,7 +37,7 @@ function roadblock_init() {
   if (!$enable || $_GET['q'] == 'admin/settings/roadblock') {
     return;
   }
-  
+
   // Start process
   $user_agent = $_SERVER['HTTP_USER_AGENT'];
   if (!isset($_COOKIE['roadblock']) && !roadblock_agent_in_db($user_agent)) {
@@ -66,7 +63,7 @@ function roadblock_agent_in_db($user_agent) {
  */
 function roadblock_cron() {
   $enable = variable_get('roadblock_cron_enable', 0);
-  if (!$enable) { 
+  if (!$enable) {
     return;
   }
   $interval = variable_get('roadblock_cron_interval', 168);
@@ -74,7 +71,7 @@ function roadblock_cron() {
   if ((time() - $last_run) < ($interval * 3600)) {
     return;
   }
-  
+
   // Refresh
   _roadblock_refresh_agent();
   variable_set('roadblock_cron_last_run', time());
@@ -160,27 +157,27 @@ function roadblock_admin_settings() {
   return system_settings_form($form);
 }
 
-function roadblock_admin_settings_validate($form_id, $form_values) {
-  if (!empty($form_values['roadblock_enable']) && empty($form_values['roadblock_page'])) {
+function roadblock_admin_settings_validate($form, &$form_state) {
+  if (!empty($form_state['values']['roadblock_enable']) && empty($form_state['values']['roadblock_page'])) {
     form_set_error('roadblock_page', t('Please input a page path'));
   }
-  if (!empty($form_values['roadblock_enable']) &&
-    (!is_numeric($form_values['roadblock_life']) || (int)$form_values['roadblock_life'] < 1)) {
+  if (!empty($form_state['values']['roadblock_enable']) &&
+    (!is_numeric($form_state['values']['roadblock_life']) || (int)$form_state['values']['roadblock_life'] < 1)) {
     form_set_error('roadblock_life', t('Please input a valid number in seconds.'));
   }
-  if (!empty($form_values['roadblock_cron_enable']) &&
-    (!is_numeric($form_values['roadblock_cron_interval']) || (int)$form_values['roadblock_cron_interval'] < 1)) {
+  if (!empty($form_state['values']['roadblock_cron_enable']) &&
+    (!is_numeric($form_state['values']['roadblock_cron_interval']) || (int)$form_state['values']['roadblock_cron_interval'] < 1)) {
     form_set_error('roadblock_cron_interval', t('Please input a valid number in hours.'));
   }
 }
 
-function roadblock_admin_settings_submit($form_id, $form_values) {
-  $op = isset($form_values['op']) ? $form_values['op'] : '';
+function roadblock_admin_settings_submit($form, &$form_state) {
+  $op = isset($form_state['values']['op']) ? $form_state['values']['op'] : '';
   if ($op == t('Refresh')) {
     _roadblock_refresh_agent();
   }
   else {
-    unset($form_values['roadblock_refresh_agent']);
-    system_settings_form_submit($form_id, $form_values);
+    unset($form_state['values']['roadblock_refresh_agent']);
+    system_settings_form_submit($form, $form_state);
   }
-}
\ No newline at end of file
+}
