Updated to work with Drupal 7